package com.xlf.service.base.controller.admin;

import com.xlf.common.core.pojo.mode.AjaxResult;
import com.xlf.common.core.pojo.mode.BaseController;
import com.xlf.service.base.service.ProblemCaseService;
import com.xlf.service.base.service.importProblem.impl.ProblemCaseImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
 * @Author xlf 2734029211@qq.com
 * @Date 2023/11/28 12:59
 * @Description: TODO
 * @Version 1.0
 */
@RestController
@RequestMapping("/base/admin/problemCase")
public class AdminProblemCaseController extends BaseController {

    @Autowired
    ProblemCaseService problemCaseService;

    /**
     * 上传测试用例zip
     * @param file
     * @return
     */
    @PreAuthorize("@ss.hasPermi('base:admin:problemCase:uploadProblemCaseZip')")
    @PostMapping("/uploadProblemCaseZip")
    public AjaxResult uploadTestcaseZip(MultipartFile file)  {

        ProblemCaseImportService problemCaseImportService = new ProblemCaseImportService();
        return success(problemCaseImportService.uploadTestcaseZip(file));

    }

}
